import request from "umi-request"

const employees = [
    {
        key: '1',
        name: 'John Brown',
        age: 32,
        address: 'New York No. 1 Lake Park',
        tags: ['nice', 'developer'],
    },
    {
        key: '2',
        name: 'Jim Green',
        age: 42,
        address: 'London No. 1 Lake Park',
        tags: ['loser'],
    },
    {
        key: '3',
        name: 'Joe Black',
        age: 32,
        address: 'Sidney No. 1 Lake Park',
        tags: ['cool', 'teacher'],
    },
]

export default {
    'GET /api/employees': (_, response) => {
        response.send(employees)
    },
    'POST /api/employee/create': (request, response) => {
        response.setHeader('Access-Control-Allow-Origin', '*');
        response.end('ok');
    }
}